package cn.com.huzo.repository.manufacture.impl;

import cn.com.huzo.model.entities.manufacture.CommissionProcessingContractLinesMoEntity;
import cn.com.huzo.repository.manufacture.CommissionProcessingContractLinesMoRepository;
import huzofw.repository.impl.GenericRepositoryImpl;
import huzofw.repository.impl.MyBatisDaoUtils;
import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * 加工加工承揽合同 加工明细数据访问对象。
 *
 * @author 吴旭
 */
@Repository("CommissionProcessingContractLinesMoRepository")
public class CommissionProcessingContractLinesMoRepositoryImpl extends GenericRepositoryImpl<CommissionProcessingContractLinesMoEntity, String>
        implements CommissionProcessingContractLinesMoRepository {

    private final String namespace = "cn.com.huzo.repository.manufacture.CommissionProcessingContractLinesMoRepository";

    /**
     * 构造函数,设置the entity to SampleLinesRepositoryImpl.class.
     */
    public CommissionProcessingContractLinesMoRepositoryImpl() {
        super(CommissionProcessingContractLinesMoEntity.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<CommissionProcessingContractLinesMoEntity> fetchByHeaderKey(Long headerKey) {
        return getSqlSession().selectList(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchByHeaderKey"), headerKey);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<CommissionProcessingContractLinesMoEntity> fetchStyleNoByHeaderKey(Long headerKey) {
        return getSqlSession().selectList(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchStyleNoByHeaderKey"), headerKey);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchInsert(List<CommissionProcessingContractLinesMoEntity> itemList) {
        return getSqlSession().insert(MyBatisDaoUtils.getMapperQueryId(
                namespace, "batchInsert"), itemList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchUpdate(List<CommissionProcessingContractLinesMoEntity> itemList) {
        return getSqlSession().update(MyBatisDaoUtils.getMapperQueryId(
                namespace, "batchUpdate"), itemList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer delete(String linesKey) {
        return getSqlSession().delete(MyBatisDaoUtils.getMapperQueryId(
                namespace, "delete"), linesKey);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchDelete(List<CommissionProcessingContractLinesMoEntity> itemList) {
        return getSqlSession().delete(MyBatisDaoUtils.getMapperQueryId(
                namespace, "batchDelete"), itemList);
    }
}
